package com.ydj.framework.mysql;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;

public interface BaseDao<T extends BaseEntity> extends IService<T> {
    default boolean exist(Long id) {
        LambdaQueryWrapper<T> queryWrapper = new LambdaQueryWrapper<T>()
                .eq(T::getId, id)
                .last(" limit 1");
        return this.count(queryWrapper) > 0;
    }
}